Skip to content

Fix activation command in azure.yaml for virtual environment#19

Open
jmservera wants to merge 1 commit intoAzure-Samples:mainfrom
jmservera:jmservera/azd-up-linux-fix
Open

Fix activation command in azure.yaml for virtual environment#19
jmservera wants to merge 1 commit intoAzure-Samples:mainfrom
jmservera:jmservera/azd-up-linux-fix

Conversation

@jmservera
Copy link

Purpose

  • When running azd up from a Linux shell, the postprovision command fails with an error stating source command not found. When the source .venv/bin/activate command is used to activate the virtual environment, the source command is not found because the script is marked with #!/bin/sh and not #!/bin/bash, and the source command is not present in the sh shell. The fix uses . .venv/bin/activate to activate the virtual environment, as using dot is compatible with other shells like sh.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

This pull request includes a small change to the azure.yaml file. The change modifies the command used to activate the virtual environment in the hooks: section.

  • azure.yaml: Changed source .venv/bin/activate to . .venv/bin/activate to activate the virtual environment.
[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code from a linux machine or WSL and then:
azd up
  • Test the code

What to Check

Verify that the following are valid

  • The postprovision command does not show an error stating source command not found

Other Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant